package com.heer.gymnasium.module.message.beans;

import com.heer.gymnasium.base.BaseBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yan
 * on 2018/2/13
 * 消息实体类
 */

public class MsgBean extends BaseBean {

    private String id;
    private String content;
    private String msgType;
    private String orderId;
    private String initiateOrderId;
    private String corpsId;
    private String title;
    private String readStatus;
    private long time;
    private String foreign_id;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getCorpsId() {
        return corpsId;
    }

    public void setCorpsId(String corpsId) {
        this.corpsId = corpsId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getReadStatus() {
        return readStatus;
    }

    public void setReadStatus(String readStatus) {
        this.readStatus = readStatus;
    }

    public String getInitiateOrderId() {
        return initiateOrderId;
    }

    public void setInitiateOrderId(String initiateOrderId) {
        this.initiateOrderId = initiateOrderId;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getForeign_id() {
        return foreign_id;
    }

    public void setForeign_id(String foreign_id) {
        this.foreign_id = foreign_id;
    }

    //数据转换
    public static List<MsgBean> dataChange(List<MsgListResponseBean.Item> data) {
        List<MsgBean> list = new ArrayList<>();
        if (data != null) {
            for (int i = 0; i < data.size(); i++) {
                MsgBean bean = new MsgBean();
                MsgListResponseBean.Item item = data.get(i);
                bean.setId(item.getMsg_id());
                bean.setOrderId(item.getOrder_id());
                bean.setCorpsId(item.getCorps_id());
                bean.setTitle(item.getTitle());
                bean.setContent(item.getContent());
                bean.setReadStatus(item.getRead_status());
                bean.setMsgType(item.getType());
                bean.setInitiateOrderId(item.getOrder_pid());
                bean.setTime(item.getCreate_time());
                bean.setForeign_id(item.getForeign_id());
                list.add(bean);
            }
        }
        return list;
    }
}
